package com.lagou.homework.controller;

import lombok.RequiredArgsConstructor;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.jdbc.core.JdbcTemplate;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/api/v1/")
@RequiredArgsConstructor(onConstructor = @__(@Autowired))
public class TestZookeeperController {

    private final JdbcTemplate jdbcTemplate;

    @GetMapping("/version")
    public String getVersion() {
        return jdbcTemplate.queryForObject("select version from version",String.class);
    }

}


